--[[-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-8-20
-- Description: DO NOT EDIT; Code generated by "ipmi_message.lua.mako"
]] --
local validate = require 'mc.validate'
local utils = require 'mc.utils'

local SetSecretNumber = {}

---@class MyAppIpmiCmds.SetSecretNumberReq
---@field Data integer
local TSetSecretNumberReq = {}
TSetSecretNumberReq.__index = TSetSecretNumberReq
TSetSecretNumberReq.group = {}

local function TSetSecretNumberReq_from_obj(obj)
    return setmetatable(obj, TSetSecretNumberReq)
end

function TSetSecretNumberReq.new(Data)
    return TSetSecretNumberReq_from_obj({Data = Data})
end
---@param obj MyAppIpmiCmds.SetSecretNumberReq
function TSetSecretNumberReq:init_from_obj(obj)
    self.Data = obj.Data
end

function TSetSecretNumberReq:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetSecretNumberReq.group)
end

TSetSecretNumberReq.from_obj = TSetSecretNumberReq_from_obj

TSetSecretNumberReq.proto_property = {'Data'}

TSetSecretNumberReq.default = {0}

TSetSecretNumberReq.struct = {{name = 'Data', is_array = false, struct = nil}}

function TSetSecretNumberReq:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'Data', self.Data, 'uint32', false, errs, need_convert)

    TSetSecretNumberReq:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetSecretNumberReq.proto_property, errs, need_convert)
    return self
end

function TSetSecretNumberReq:unpack(_)
    return self.Data
end

SetSecretNumber.SetSecretNumberReq = TSetSecretNumberReq

---@class MyAppIpmiCmds.SetSecretNumberRsp
---@field CompletionCode integer
local TSetSecretNumberRsp = {}
TSetSecretNumberRsp.__index = TSetSecretNumberRsp
TSetSecretNumberRsp.group = {}

local function TSetSecretNumberRsp_from_obj(obj)
    return setmetatable(obj, TSetSecretNumberRsp)
end

function TSetSecretNumberRsp.new(CompletionCode)
    return TSetSecretNumberRsp_from_obj({CompletionCode = CompletionCode})
end
---@param obj MyAppIpmiCmds.SetSecretNumberRsp
function TSetSecretNumberRsp:init_from_obj(obj)
    self.CompletionCode = obj.CompletionCode
end

function TSetSecretNumberRsp:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetSecretNumberRsp.group)
end

TSetSecretNumberRsp.from_obj = TSetSecretNumberRsp_from_obj

TSetSecretNumberRsp.proto_property = {'CompletionCode'}

TSetSecretNumberRsp.default = {0}

TSetSecretNumberRsp.struct = {{name = 'CompletionCode', is_array = false, struct = nil}}

function TSetSecretNumberRsp:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CompletionCode', self.CompletionCode, 'uint8', false, errs, need_convert)

    TSetSecretNumberRsp:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetSecretNumberRsp.proto_property, errs, need_convert)
    return self
end

function TSetSecretNumberRsp:unpack(_)
    return self.CompletionCode
end

SetSecretNumber.SetSecretNumberRsp = TSetSecretNumberRsp

return SetSecretNumber
